#ifndef READARGUMENTS_H_INCLUDED
#define READARGUMENTS_H_INCLUDED

#include <iostream>
#include "../evolution/evolution.h"
#include <cstring>

class ReadArguments {
    private:
        void readEXEName(char *argv[]);
        // reads and stores the filename of this pice of software
        void readMinusCommand(const int& position, char *argv[]);
        // -        commands starting with a '-' reach here
        void readDoubleMinusCommand(char* word);
        // --       commands starting with two '-' reach here
        void showHelp();
        // --help   print a typical help
        void commandNotFound(char* word);
        // crap     print standard command not found message
        void setAmountOfInputPrimes(const unsigned int& amount);
        // set primes-input-size-option
        void setAmountOfEvolutionElements(const unsigned int& amount);
        // set amount of evolution elements
        void setAmountOfFormulasPerElement(const unsigned int& amount);
        // set amount of formulas per element
        void setSizeOfNewCreatedFormulas(const unsigned int& size);
        // set size of new created formulas
        void setAmountOfRounds(const unsigned int& rounds);
        // set amount of rounds to be done by the evolution
        void setInputFileName(const char* name);
        // set fileName of the inputfile
        bool isANumber(const char& c);
        // tests a char wheter it's a number between 0 and 9
        void printError(std::string& s);
        // print basic Error Message including given string
        void printAllValues();
        // prints all variable values to screen


        Input* input;
        // input
        bool runEvolution;
        // start evolution or exit without starting (--help)
        unsigned int myAmountOfEvolutionElements;
        // amount of interacting but separate evolution elements
        unsigned int myAmountOfFormulasPerElement;
        // amount of formulas per evolution element
        unsigned int mySizeOfNewCreatedFormulas;
        // size of new formulas - should be a number x where 2 < x and x = 3+2n  (n e N)
        unsigned int myAmountOfRounds;
        // amount of evolution-runs
        std::string myInputFileName;
        // file name of the inputfile
        bool usePrimes;
        // true if primes are used as input
        unsigned int amountOfPrimes;
        // the first amountOfPrimes primes are used as evolutioninput

        char *exeFileName;
        // the name of this pice of software

    public:
        ReadArguments();
        // constructor
        ~ReadArguments();
        // destructor
        void decryptAndExecute(const int& argc, char *argv[], char *envp[]);
        // Main-Method of this class
};

#endif // READARGUMENTS_H_INCLUDED
